<template>
   <NavBar :title="$route.meta.name" :left-arrow="$route.meta.needBack"  @click-left="handleGoBack"></NavBar> 
   <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <!-- 不需要缓存 -->
    <router-view v-if="!$route.meta.keepAlive"></router-view>
</template>
<script setup>
import { useRouter } from 'vue-router'
import { NavBar } from 'vant'
const router = useRouter()
function handleGoBack(){
  router.back()
}
</script>

<style>
#app {
  margin: 0;
  padding: 0;
  background-color: #f2f2f2;
  min-height: 100vh;
  width: 100%;
}
</style>
